<template>
  <t-dialog :header="dialogInfo.header" :visible.sync="dialogInfo.visible" :onClose="closeDialog"
    :closeOnOverlayClick="false" :confirmBtn="null" width="90%" top="5%">
    <t-tabs v-model="value" size="medium">
      <t-tab-panel value="1" label="创新工作室详情">
        <t-form labelWidth="140px" :colon="true">
          <t-row style="align-items: stretch;padding: 10px">
            <t-col :span="12">
              <t-card class="step-card" size="small" title="基本信息">
                <t-row style="align-items: stretch;padding: 10px">
                <t-col :span="6">
                  <t-form-item label="工作室名称" name="name">
                    {{ data.name }}
                  </t-form-item>
                  <t-form-item label="级别" name="level">
                    {{ data.level | filterByDict(dict.type.innovation_studio_level) }}
                  </t-form-item>
                  <t-form-item label="承担单位" name="holdCompany">
                    {{data.holdCompany}}
                  </t-form-item>
                  <t-form-item label="负责人" name="leaderName">
                    {{ data.leaderName }}
                  </t-form-item>
                </t-col>
                  <t-col :span="6">
                    <t-form-item label="联系方式" name="phone">
                      {{ data.phone }}
                    </t-form-item>
                    <t-form-item label="地址" name="address">
                      {{ data.address }}
                    </t-form-item>
                    <t-form-item label="邮编" name="postCode">
                      {{ data.postCode }}
                    </t-form-item>
                    <t-form-item label="成立时间" name="buildDate">
                      {{ data.buildDate }}
                    </t-form-item>
                  </t-col>
                </t-row>
              </t-card>
              <t-card class="step-card" size="small" title="简介">
                <t-row style="align-items: stretch;padding: 10px">
                  <t-col :span="12">
                    <t-form-item label="" name="content">
<!--                      <div v-html="data.content"></div>-->
                      <inner-html :content="data.contentt"></inner-html>

                    </t-form-item>
                  </t-col>
                </t-row>
              </t-card>
            </t-col>
          </t-row>
        </t-form>
      </t-tab-panel>
      <t-tab-panel value="2" label="每年的效益">
        <studioBenefits ref="studioBenefits" :edit-open="false" v-model="data.studioBenefits" :value="data.studioBenefits"></studioBenefits>
      </t-tab-panel>
    </t-tabs>

  </t-dialog>
</template>

<script>

import {getFiles} from "@/api/common";
import studioBenefits from "@/pages/tjpt/platform/components/studioBenefits.vue";
import InnerHtml from "@/components/InnerHtml/index.vue";

export default {
  name: "bzhList-detail-dialog",
  dicts:["formulate_type","bzh_approve_type","approve_status","local_standard_status","standard_category","standard_property","prof_tit","innovation_studio_level"],
  components: {
    studioBenefits,
    InnerHtml
  },
  props: {
    dialogInfo: {
      type: Object,
      default() {
        return {
          id: "",
          header: "",
          visible: true
        }
      }
    },
  },
  data() {
    return {
      columns: [
        {colKey: 'userName', title: '成员名称'},
        {colKey: 'profTitId', title: '技术职称'},
        {colKey: 'profTit', title: '职称等级'},
        {colKey: 'deptId', title: '单位名称'},
        {colKey: 'phone', title: '电话'},
        {colKey: 'postCode', title: '邮编'},
      ],
      value:"1",
      deptMenuOptions:[],
      projectFileColumns: [
        {
          colKey: "id",
          title: "序号",
          align: "center",
          width: 64
        },
        {
          colKey: "c1",
          title: "附件名称",
          align: "center",
        },
        {
          colKey: "c2",
          title: "是否必需",
          align: "center",
        },
        {
          colKey: "op",
          title: "附件列表",
          align: "left",
        },
      ],
      projectFileData: [
        {
          id: 1,
          c1: "立项阶段",
          c2: "否",
          moduleKey: "bzhLXJD",
          fileIds: [],
          fileLists: [],
        },
        {
          id: 2,
          c1: "报审阶段",
          c2: "否",
          moduleKey: "bzhBSJD",
          fileIds: [],
          fileLists: [],
        },
        {
          id: 3,
          c1: "报批阶段",
          c2: "否",
          moduleKey: "bzhBPJD",
          fileIds: [],
          fileLists: [],
        },
        {
          id: 4,
          c1: "发布阶段",
          c2: "否",
          moduleKey: "bzhFBJD",
          fileIds: [],
          fileLists: [],
        },
        {
          id: 5,
          c1: "贯标附件",
          c2: "否",
          moduleKey: "bzhGBFJ",
          fileIds: [],
          fileLists: [],
        },
      ],
      tabValue:"1",
      profTitOptions:[],
      data: {
        draftUnits:[{}]
      },
    }
  },

  async mounted() {
    await this.getDeptTreeSelect()
    await this.getProfTitTreeSelect()
    await this.getDetail()

  },
  methods: {
    getProfTitTreeSelect() {
      return this.$api.system.profTit.treeselect().then(response => {
        this.profTitOptions = response.data;
      }).catch((e) => {
        this.$message.error(e.toString());
      });
    },
    getDeptTreeSelect(){
      return this.$api.system.dept.treeSelectAllIn().then(response=>{
        this.deptMenuOptions = response.data
      }).catch(e=>{
        this.$message.error(e.toString())
      })
    },
    closeDialog() {
      this.$emit("closeBzhDialog", false);
      this.dialogInfo.visible = false
    },
    getDetail(){
      this.$api.tjpt.innovation.get(this.dialogInfo.id).then(response=>{
        this.data = response.data
        // this.$api.bzh.standard.draftPerson(this.dialogInfo.id).then(response=>{
        //   this.data.draftPersons = response.data
        // })

      })
    },
  }
}
</script>

<style lang="less" scoped>
.card{
  margin-bottom: 14px;
}
.step-card{
  margin: 10px;
}
.content_style{
  font-size: 12pt;
  font-family: 宋体;
  line-height: 1.5;
}
</style>
